/**
* @Title: warning_service.js
* @Description: TODO
* Copyright: Copyright (c) 2014 
 * Company:中国平安
*
* @Project HIMS-FWA
* @date 2014年9月25日 上午10:39:31
* @version V1.0
*/
;
(function(){
	'use strict';

	var app = angular.module('fwa.mainApp');
	app.service('WarningService',['$http','Modal','BaseURL',
	                  function($http,Modal,baseUrl){
		var debug = false,
		serv = this,
		debugUrls = {
				getWarning: baseUrl + 'mock/hcpms/warning/warning.json'
			},
			urls = {
				getWarning: baseUrl + 'warning/findWarningList.do'
			};
		function getUrl(name) {
			if(debug) {
				return debugUrls[name];
			} else {
				return urls[name];
			}
		}
		/**获取预警事件列表**/
		serv.query = function(jsonObj){
              return $http({
                  url:getUrl('getWarning'),
                  method:'GET',
                  params:jsonObj
              });
          };

  		/**获取预警事件登记列表**/
  		serv.warningAddQuery = function(jsonObj){
                return $http({
                    url:baseUrl + 'warning/findWarningAddList.do',
                    method:'GET',
                    params:jsonObj
                });
            };
            

  		/**获取预警事件筛查列表**/
  		serv.warningScreenQuery = function(jsonObj){
                return $http({
                    url:baseUrl + 'warning/findWarningScreenList.do',
                    method:'GET',
                    params:jsonObj
                });
            };
            
  		/**获取预警事件审核列表**/
  		serv.warningAuditQuery = function(jsonObj){
                return $http({
                    url:baseUrl + 'warning/findWarningAuditList.do',
                    method:'GET',
                    params:jsonObj
                });
            };
            
  		/**获取预警事件反馈评估列表**/
  		serv.warningAssessQuery = function(jsonObj){
                return $http({
                    url:baseUrl + 'warning/findWarningAssessList.do',
                    method:'GET',
                    params:jsonObj
                });
            };
            
  		/**获取预警事件结论审核列表**/
  		serv.warningResultAuditQuery = function(jsonObj){
                return $http({
                    url:baseUrl + 'warning/findWarningResultAuditList.do',
                    method:'GET',
                    params:jsonObj
                });
            };
            
  		/**获取预警事件审批列表**/
  		serv.warningApproveQuery = function(jsonObj){
                return $http({
                    url:baseUrl + 'warning/findWarningApproveList.do',
                    method:'GET',
                    params:jsonObj
                });
            };
            
          /**医疗机构**/
          serv.initMedicalOrgInfoList = function(){
  			if(!serv.medicalOrgInfoList){
				$http({
			    	 method: "get",
			    	 url:baseUrl+'community/getNewMedicalOrgInfoList.do'
				}).success(function(response, status, headers, config){
					serv.medicalOrgInfoList = response.medicalOrgList;
				});
			}
  		}

		/**获取任务节点列表**/
          serv.getActinstList = function(){
        	  if(!serv.actinstList){
  				$http({
  			    	 method: "get",
  			    	 url:baseUrl+'warning/getActinstInfo.do'
  				}).success(function(response, status, headers, config){
  					serv.actinstList = response.result;
  				});
  			}
          };


 	     
	}]);
	
})();